﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AirlineBooking.Models.DTO;
using AirlineBooking.Models;

namespace AirlineBooking.Controllers
{
    public class AirportController : Controller
    {
        //
        // GET: /Airport/

        public JsonResult AirpotList()
        {
            return Json(new AirportModel().GetAirportList(), JsonRequestBehavior.AllowGet);
        }

        public JsonResult AirportOfCity(int id)
        {
            return Json(new AirportModel().GetCityAirports(id), JsonRequestBehavior.AllowGet);
        }

        public JsonResult GetAirport(string AirportCode)
        {
            return Json(new AirportModel().GetAirport(AirportCode), JsonRequestBehavior.AllowGet);
        }
    }
}
